A blurring effect. More...
Public Member Functions | |
BlurComplexEffect (nkMemory::StringView name) | |
~BlurComplexEffect () | |
virtual COMPLEX_EFFECT_TYPE | getType () const override |
nkGraphics::Texture * | getSourceTexture () const |
nkGraphics::Texture * | getOutputTexture () const |
unsigned int | getKernelRadius () const |
bool | getAlphaEncodesBlurPlanes () const |
bool | getPreserveAlpha () const |
void | setSourceTexture (nkGraphics::Texture *value) |
void | setKernelRadius (unsigned int value) |
void | setAlphaEncodesBlurPlanes (bool value) |
void | setPreserveAlpha (bool value) |
virtual bool | load () override |
virtual void | unload () override |
![]() | |
ComplexEffect (nkMemory::StringView name) | |
virtual | ~ComplexEffect () |
nkMemory::StringView | getName () const |
nkGraphics::CompositorNode * | getCompositorNode () const |
void | setName (const nkMemory::StringView &value) |
void | setCompositorNode (nkGraphics::CompositorNode *value) |
A blurring effect.
This effect will blur the source texture, given provided parameters.
nkAstraeus::BlurComplexEffect::BlurComplexEffect | ( | nkMemory::StringView | name | ) |
Default constructor. See ComplexEffectManager::createOrRetrieve().
name | The name of the effect. |
nkAstraeus::BlurComplexEffect::~BlurComplexEffect | ( | ) |
Default destructor. See ComplexEffectManager::erase().
|
overridevirtual |
Implements nkAstraeus::ComplexEffect.
nkGraphics::Texture* nkAstraeus::BlurComplexEffect::getSourceTexture | ( | ) | const |
nkGraphics::Texture* nkAstraeus::BlurComplexEffect::getOutputTexture | ( | ) | const |
unsigned int nkAstraeus::BlurComplexEffect::getKernelRadius | ( | ) | const |
bool nkAstraeus::BlurComplexEffect::getAlphaEncodesBlurPlanes | ( | ) | const |
bool nkAstraeus::BlurComplexEffect::getPreserveAlpha | ( | ) | const |
void nkAstraeus::BlurComplexEffect::setSourceTexture | ( | nkGraphics::Texture * | value | ) |
Sets the texture to use as input to the effect.
value | The texture to use as input. |
void nkAstraeus::BlurComplexEffect::setKernelRadius | ( | unsigned int | value | ) |
Sets the kernel radius for the blurring operation. Defaults to 5.
value | The radius, in pixel, for the blurring operation. For instance, a radius of 1 will blur using 1 pixel around the reference pixel. |
void nkAstraeus::BlurComplexEffect::setAlphaEncodesBlurPlanes | ( | bool | value | ) |
Sets whether the effect should consider alpha as encoding blurring planes. Blurring planes can be used to isolate and blur sub-parts of an image, independently. For instance, having a part of an image with an alpha of 0.2, and another one of 0.3, will blur together the pixels with alpha 0.2, excluding the 0.3 pixels, and vice versa. Defaults to false.
value | Whether the alpha encodes blurring planes (true) or not (false). |
void nkAstraeus::BlurComplexEffect::setPreserveAlpha | ( | bool | value | ) |
Sets whether the alpha channel should be preserved while blurring, or not. A preserved alpha channel will either get blurred like any other color channel if not encoding a plane, either keep the plane information after blurring. Defaults to false. If not preserved, the effect will overwrite any alpha information with 1 in the output texture.
value | Whether the alpha should be preserved (true) or not (false). |
|
overridevirtual |
Implements nkAstraeus::ComplexEffect.
|
overridevirtual |
Implements nkAstraeus::ComplexEffect.